<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<%@ include file="../../common/jsp/sheetHeader.jsp" %>
<link rel="Stylesheet" type="text/css" href="/Mass_template/common/colpick/css/colpick.css" />
<script type="text/javascript" src="/Mass_template/common/colpick/js/colpick.js"></script>
<style>
.picker {
	margin:0;
	padding:0;
	border:0;
	width:60px;
	height:20px;
 	border-right:20px solid #ccc;
	border-left:1px solid #ccc;
	border-top:1px solid #ccc;
	border-bottom:1px solid #ccc;
	line-height:20px;
}
</style>
<script>
	$(document).ready(function() {
		//sheet 초기화  
		createIBSheet2(document.getElementById("viewArea"),"mySheet","100%","400px");
		
		var cfg = {FrozenCol:3,FrozenColRight:1,SearchMode:smLazyLoad,Page:30};
		var headers = [
			{Text:"NO|상태|삭제|체크박스|더미체크|라디오|텍스트|멀티라인|콤보|Edit콤보|팝업|Edit팝업|정수|실수|계산1\n(실수/3)|계산2\n(계산1*2)|정수(Null)|실수(Null)|년월일|년월|월일|시분초|시분|Format:\"#\"|Format:\"#,###.##\"|Format:\"Number\"|Format:\"###\"|주민번호마스킹|이미지|암호",Align:"Center"}
		];
		var info = {Sort:1,ColMove:1,ColResize:1,HeaderCheck:0};
		var cols = [
				{Type:"Seq",Width:50,SaveName:"sSeq",Align:"Center"},
				{Type:"Status",Width:50,SaveName:"sStatus",Align:"Center"},
				{Type:"DelCheck",Width:50,SaveName:"sDelete",Align:"Center",Hidden:1},
				{Type:"CheckBox",Width:80,SaveName:"sCheck",Align:"Center",Hidden:1},
				{Type:"DummyCheck",Width:70,SaveName:"sDummy",Align:"Center",HeaderCheck:0,Hidden:1},
				{Type:"Radio",Width:60,SaveName:"sRadio",Align:"Center",Hidden:1},
				{Type:"Text",Width:70,SaveName:"sText",Align:"Center",KeyField:1,ColMerge:1,Wrap:1, BackColor:'#FF9E9B'},
				{Type:"Text",Width:70,SaveName:"sMultiLine",Align:"Center", MultiLineText:1,Hidden:1},
				{Type:"Combo",Width:85,SaveName:"sCombo",Align:"Center",ColMerge:0,ComboText:"전체|평일|주말|여름성수기|겨울성수기",ComboCode:"*|1|2|3|4",Hidden:1},
				{Type:"ComboEdit",Width:80,SaveName:"sComboEdit",Align:"Left",ColMerge:0,ComboText:"전체|한화콘도|한국콘도|글로리콘도|삼립하일라|두산콘도",ComboCode:"100|101|105|110|115|120",Hidden:1},
				{Type:"Popup",Width:130,SaveName:"sPopup",Align:"Left",ColMerge:0,Hidden:1},
				{Type:"PopupEdit",Width:65,SaveName:"sPopupEdit",Align:"Right",Hidden:1},
				{Type:"AutoSum",Width:80,SaveName:"sInteger",Align:"Right",ColMerge:0,Format:"Integer",Hidden:1},
				{Type:"AutoSum",Width:80,SaveName:"sFloat",Align:"Right",ColMerge:0,Format:"Float",PointCount:2,Hidden:1},
				{Type:"AutoSum",Width:80,SaveName:"sFloatCalc",Align:"Right",ColMerge:0,Format:"Float",CalcLogic:"|13|/3",PointCount:2,Hidden:1},
				{Type:"AutoSum",Width:80,SaveName:"sNullFloatCalc",Align:"Right",ColMerge:0,Format:"NullFloat",CalcLogic:"|14|*2",PointCount:2,Hidden:1},
				{Type:"AutoSum",Width:80,SaveName:"sNullInteger",Align:"Right",ColMerge:0,Format:"NullInteger"},
				{Type:"AutoSum",Width:80,SaveName:"sNullFloat",Align:"Right",ColMerge:0,Format:"NullFloat",PointCount:2},
				{Type:"Date",Width:90,SaveName:"sDateYmd",Align:"Center",ColMerge:0,Format:"Ymd",Hidden:1},
				{Type:"Date",Width:80,SaveName:"sDateYm",Align:"Center",ColMerge:0,Format:"Ym",Hidden:1},
				{Type:"Date",Width:70,SaveName:"sDateMd",Align:"Center",ColMerge:0,Format:"Md",Hidden:1},
				{Type:"Date",Width:60,SaveName:"sDateHms",Align:"Center",ColMerge:0,Format:"Hms",Hidden:1},
				{Type:"Date",Width:60,SaveName:"sDateHm",Align:"Center",ColMerge:0,Format:"Hm",Hidden:1},
				{Type:"Int",Width:120,SaveName:"sTextId",Align:"Center",ColMerge:0,Format:"#"},
				{Type:"Int",Width:110,SaveName:"sTextSaup",Align:"Center",ColMerge:0,Format:"#,###.##"},
				{Type:"Text",Width:140,SaveName:"sTextCard",Align:"Center",ColMerge:0,Format:"Number"},
				{Type:"Text",Width:90,SaveName:"sTextPost",Align:"Center",ColMerge:0,Format:"###"},
				{Type:"Text",Width:120,SaveName:"sUserFormat",Align:"Center",ColMerge:0,Format: "######-*******",Hidden:1},
				{Type:"Image",Width:70,SaveName:"sImage",Align:"Center",ColMerge:0,Hidden:1},
				{Type:"Pass",Width:70,SaveName:"sPass",Align:"Center",ColMerge:0,Hidden:1}
		];

		mySheet.SetConfig(cfg);
		mySheet.InitHeaders(headers,info);
		mySheet.InitColumns(cols);

		mySheet.FitColWidth();
		
		doAction("search");
	});
	
	/*Sheet 각종 처리*/
	function doAction(sAction) {
		
		switch(sAction) {
			case "search":		//조회
				mySheet.DoSearch("../data/Down2Excel_data.xml");
				break;
			case "subsum":
			    var info = [{StdCol:0, SumCols:"2|3|4|5", ShowCumulate:0,Sort:0,CaptionCol:0}];
			   	mySheet.ShowSubSum(info); 
			   	doAction('search');
		    break;
		}
	}
	
	
</script>
<title>특이한 숫자 포맷 예제</title>
</head>
<body>
<div id="main">
	<%@ include file="../../common/jsp/sheetNavi.jsp" %>
	<div id="title">특이한 숫자 포맷 예제</div>
	<div id="desc">
		
	</div>

	<div id="functionArea">
		<div>
		컬럼 설정시 셀 값을 확인하여 포맷을 변경할 수 있다.<br>
		사용자 숫자 포맷 가이드 "#", "0", "," "." 조합으로 기본제공 포맷 이외의 포맷을 정의하여 사용 할 수 있다.<br>
		사용가능한 타입은 Int, Float, AutoSum, AutoAvg 타입이다.
		</div>
		<br>
		<div>var cols = [<br>
		&nbsp;&nbsp;&nbsp;&nbsp;.<br>
		&nbsp;&nbsp;&nbsp;&nbsp;.<br>
		&nbsp;&nbsp;&nbsp;&nbsp;{Type:"Int",Width:120,SaveName:"sTextId",Align:"Center",ColMerge:0,<font color="#FF0000"><u>Format:"#"</u></font>},<br>
		&nbsp;&nbsp;&nbsp;&nbsp;{Type:"Int",Width:110,SaveName:"sTextSaup",Align:"Center",ColMerge:0,<font color="#FF0000"><u>Format:"#,###.##"</u></font>},<br>
		&nbsp;&nbsp;&nbsp;&nbsp;{Type:"Text",Width:140,SaveName:"sTextCard",Align:"Center",ColMerge:0,<font color="#FF0000"><u>Format:"Number"</u></font>},<br>
		&nbsp;&nbsp;&nbsp;&nbsp;{Type:"Text",Width:90,SaveName:"sTextPost",Align:"Center",ColMerge:0,<font color="#FF0000"><u>Format:"###"</u></font>},<br>
		&nbsp;&nbsp;&nbsp;&nbsp;.<br>
		&nbsp;&nbsp;&nbsp;&nbsp;.<br>
			];
		</div>
	</div>
	
	<div id="viewArea">
	</div>
</div>
</body>
</html>